package kr.hkit.powerjava.chapter22.pro;

import java.util.ArrayList;
import java.util.Collections;
import java.util.Random;

public class Contest {
	public static void main(String[] args) {
		ArrayList<Double> list = new ArrayList<>();
	
		list.add(8.1);
		list.add(1.6);
		list.add(4.8);
		list.add(5.5);
		list.add(7.9);
		list.add(2.7);
		list.add(7.8);
		list.add(9.0);
		list.add(5.9);
		list.add(6.0);
		
		double getTotal = 0;
		
		for (int i = 0; i < list.size(); i++) {
			if(list.get(i) == Collections.max(list) || list.get(i) == Collections.min(list)) {
				continue;
			}else{
				getTotal = getTotal + list.get(i);
			}
		}
		System.out.println("심사위원의 점수" + "\n" + list);
		System.out.println("최대값은 " + Collections.max(list) + " 최소값은 " + Collections.min(list));
		System.out.printf("합계는 %3.1f", getTotal);
	}
}
